<?php
  require '../../include/library.inc.php';
  require '../../include/admin_login.inc.php';
    
  $category_id = intval($_GET['category_id']);

  if($category_id) {
	  
	$sql = "DELETE FROM 
               category
            WHERE
               category_id = '$category_id'
             ";
    query($sql);
	
	$sql = "DELETE FROM 
               category_description
            WHERE
               category_id = '$category_id'
             ";
    query($sql);
				
	$_SESSION['message'] = 'Категорията е изтрита успешно!';
	
  }
  
  redirect($_SERVER['HTTP_REFERER']);
 
?>